Depends on the way they implemented the menu (programming, language,
the form as it is executed) makes difficult or facilitates the tricks
to jump the imposed restrictions. Thats the reason why it is possible
that you need to modify a little the described forms so they can work.
2.1. TRAPS
In fact im sure that this case does not apply but is worth the trouble
to try (you neve know). " God works in mysterious ways ".
In UNIX you have combinations of keys that when they are pressed they
send a signal to the program that is executing. Depending on the sent
signal the program will abort or suspend the execution.
Multiple signals exist and if in the menu porgramming " traps " are
not handled that control the behavior of the program (menu), when
receiving a certain signal you could leave the menu without any
problem.
At the time of initiating the menu press:
CONTROL + C (Abort execution)
CONTROL + Z (Suspend execution)
CONTROL + D
NOTE: Again it is not probable that this work, just a crazy programmer
will leave this kind of things behind.
2.2 Configuration
Some menus have configuration (Setup) options, which you can modify at
any time to choose what editor you use, what type of terminal or the
mail program you prefer to work with.
For negligence in the programming of the menu is possible that u can
find fields that can be left in clean (empty) entering one or several
spaces, in the bottom for example if we enter to text editor's
configuration and we are requested to type the name of the program to
use (Ex. pico, vi) when we return to the main menu and let us choose
text editor's option the menu will make the call to the application
that previously we have typed. If in the configuration we can leave
the field in white as a group of typed spaces when we execute the menu
and we are requested the name of the file to publish (edit) there in
that moment we will be able to give him any command to execute.
If u prefers it also instead of leaving in spaces the field, just place
the command to execute,although this method is a little annoying if u will execute multiple commands.
Example.
(Setup Option)
Type The Text Editor to use (Pico , Vi)?: _ <--- spaces
(Main Menu, "Edit" Option )
Type the filename to edit: ps <------ Command
PID TT STAT TIME COMMAND
2679 p2 S 0:01 -menu
2832 p2 R 0:00 ps
This case depends on how was implemented the menu and how creative
you can be.
2.3 Beginning & Setup Files (.login ,.profile)
Commonly when you enter to your account, the shell automatically executes
Some commands included in a certain file (on tcsh it is .profile, on
other shells is .login ).
Some administrators to execute the menu every time you logon to your account they include the line in this file. If the permits were not well placed to the file it is possible to edit this file or to upload using FTP a .profile or .login according to the case, eliminating the lines that executethe menu. (Or simply erase the complete file).
If you can see the content of the setup file of the shell and you realize that
the menu is called directly without including its path, you can create a file
with the same name, containing one line as /bin/sh and then put in your
account. If the PATH variable is not well defined and the execution of the menu isn't a direct call in the file /etc/passwd, when you enter to the account
again the system will execute the mistaken menu (its kind of a Trojan Horse)
, leaving you directly in the shell defined.
NOTE: be careful with the permisions of the new file.
2.4 linking Commands
Another form of executing commands is to use characters that link
commands in the shell this way:
user1> finger @some.host.edu;ps <---------------- Check the ";"
[some.host.edu]
Welcome to Linux version 2.0.30 at some.host.edu !
Login Name Tty Idle Login Time Office Office Phone
user1 p0 1 Sep 11 14:38 (xxx.25.64.xxx)
user2 p1 Sep 11 16:01 (xxx.25.65.xxx)
user3 p3 4 Sep 11 15:29 (xxx.25.68.xxx)
PID TTY STAT TIME COMMAND
9562 p1 S 0:00 -menu
9576 p1 R 0:00 ps
Also work according to the application that in fact will be called
with rerouting characters and others ( >>,<<,>,<,&,!,;,:,|).
2.5 Ok I can execute commands. So what can i do now?
Everything: (Buffers Overflows, etc etc).
Suddenly you don't find a way to leave directly to the shell but u can
execute any command that u want. Modify an exploit that instead of executing
in their code the /bin/sh ,executes a program that for example modifies the line in /etc/passwd and /etc/shadow so that executes directly a shell and not a menu when you log on.
Compile it in another host and upload it to your account. Now execute it as if it was a simple command, the rest leaves to your imagination.
Many ways exist to be able to surpass those small limitations that
they like to create. Everything depends on the creativity and the desires
to learn that you have. The curiosity will never be a crime.
3. COMMON PROGRAMS EXPLOITS
Here are some recent exploits that can be useful according
to the case:
3.1 Latest Lynx BUGS
------------------
Michal Zalewski (lcamtuf@IDS.PL)
Sun, 6 Sep 1998 00:53:24 +0200
Trivial Overflows on:
<a href="rlogin://(aprox. 1454 veces 'A')">...</a>,
<a href="telnet://(aprox. 1454 veces 'A')">...</a> o
<a href="tn3270://(aprox. 1454 veces 'A')">...</a>
Chooses your favorite protocol, beautiful SEGV in 0x41414141. Also,
Overflows in finger://, cso://, nntp:// and news://. Unfortunately
they are not so easily exploitable. 1454 bytes are perfect for
lynx 2.8.x under Linux. It can vary in other platforms.
Nothing more to say. Me (Michal Zalewski (lcamtuf@IDS.PL)) reports similar overflows
similar in the protocol mailto: months ago. I don't have idea if they have been fixed.